/**
 * Copyright (C) 2011 the author
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.linguamathematica.oa4j;

import java.util.Set;

import static java.lang.String.format;

import com.linguamathematica.oa4j.Analysis.Decisiveness;
import com.linguamathematica.oa4j.Analysis.OfferingGuidance;
import com.linguamathematica.oa4j.Analysis.PolarityResult;
import com.linguamathematica.oa4j.Analysis.RequestingGuidance;
import com.linguamathematica.oa4j.Analysis.Result;
import com.linguamathematica.oa4j.Analysis.Temporality;

/**
 * The Class StylesAnalysis.
 */
public class StylesAnalysis
{

	/** The polarity. */
	private final PolarityResult polarity;

	/** The guidance offer. */
	private final Result<OfferingGuidance> guidanceOffer;

	/** The guidance request. */
	private final Result<RequestingGuidance> guidanceRequest;

	/** The decisiveness. */
	private final Result<Decisiveness> decisiveness;

	/** The slang. */
	private final Result<Slang> slang;

	/** The flamboyance. */
	private final Result<Flamboyance> flamboyance;

	/** The contrast. */
	private final Result<Contrast> contrast;

	/** The temporality. */
	private final Set<Result<Temporality>> temporality;

	/**
	 * Instantiates a new styles analysis.
	 * 
	 * @param polarity
	 *            the polarity
	 * @param guidanceOffer
	 *            the guidance offer
	 * @param guidanceRequest
	 *            the guidance request
	 * @param decisiveness
	 *            the decisiveness
	 * @param slang
	 *            the slang
	 * @param flamboyance
	 *            the flamboyance
	 * @param contrast
	 *            the contrast
	 * @param temporality
	 *            the temporality
	 */
	public StylesAnalysis(final PolarityResult polarity, final Result<OfferingGuidance> guidanceOffer,
			final Result<RequestingGuidance> guidanceRequest, final Result<Decisiveness> decisiveness,
			final Result<Slang> slang, final Result<Flamboyance> flamboyance, final Result<Contrast> contrast,
			final Set<Result<Temporality>> temporality)
	{
		super();
		this.polarity = polarity;
		this.guidanceOffer = guidanceOffer;
		this.guidanceRequest = guidanceRequest;
		this.decisiveness = decisiveness;
		this.slang = slang;
		this.flamboyance = flamboyance;
		this.contrast = contrast;
		this.temporality = temporality;
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see java.lang.Object#equals(java.lang.Object)
	 */
	@Override
	public boolean equals(final Object obj)
	{
		if (this == obj)
		{
			return true;
		}
		if (obj == null)
		{
			return false;
		}
		if (getClass() != obj.getClass())
		{
			return false;
		}
		final StylesAnalysis other = (StylesAnalysis) obj;

		return contrast.equals(other.contrast) && decisiveness.equals(other.decisiveness)
				&& flamboyance.equals(other.flamboyance) && guidanceOffer.equals(other.guidanceOffer)
				&& guidanceRequest.equals(other.guidanceRequest) && polarity.equals(other.polarity)
				&& slang.equals(other.slang) && temporality.equals(other.temporality);
	}

	/**
	 * Gets the contrast.
	 * 
	 * @return the contrast
	 */
	public Result<Contrast> getContrast()
	{
		return contrast;
	}

	/**
	 * Gets the decisiveness.
	 * 
	 * @return the decisiveness
	 */
	public Result<Decisiveness> getDecisiveness()
	{
		return decisiveness;
	}

	/**
	 * Gets the flamboyance.
	 * 
	 * @return the flamboyance
	 */
	public Result<Flamboyance> getFlamboyance()
	{
		return flamboyance;
	}

	/**
	 * Gets the guidance offer.
	 * 
	 * @return the guidance offer
	 */
	public Result<OfferingGuidance> getGuidanceOffer()
	{
		return guidanceOffer;
	}

	/**
	 * Gets the guidance request.
	 * 
	 * @return the guidance request
	 */
	public Result<RequestingGuidance> getGuidanceRequest()
	{
		return guidanceRequest;
	}

	/**
	 * Gets the polarity.
	 * 
	 * @return the polarity
	 */
	public PolarityResult getPolarity()
	{
		return polarity;
	}

	/**
	 * Gets the slang.
	 * 
	 * @return the slang
	 */
	public Result<Slang> getSlang()
	{
		return slang;
	}

	/**
	 * Gets the temporality.
	 * 
	 * @return the temporality
	 */
	public Set<Result<Temporality>> getTemporality()
	{
		return temporality;
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see java.lang.Object#hashCode()
	 */
	@Override
	public int hashCode()
	{
		final int prime = 31;
		int result = 1;
		result = prime * result + contrast.hashCode();
		result = prime * result + decisiveness.hashCode();
		result = prime * result + flamboyance.hashCode();
		result = prime * result + guidanceOffer.hashCode();
		result = prime * result + guidanceRequest.hashCode();
		result = prime * result + polarity.hashCode();
		result = prime * result + slang.hashCode();
		return prime * result + temporality.hashCode();
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see java.lang.Object#toString()
	 */
	@Override
	public String toString()
	{
		return format(
				"Styles Analysis%n polarity %s%n guidanceOffer %s%n guidanceRequest %s%n decisiveness %s%n slang %s%n flamboyance %s%n contrast %s%n temporality %s",
				polarity, guidanceOffer, guidanceRequest, decisiveness, slang, flamboyance, contrast, temporality);
	}

	/**
	 * The Enum Contrast.
	 */
	public enum Contrast
	{

		/** The NO t_ a t_ all. */
		NOT_AT_ALL,
		/** The T o_ som e_ extent. */
		TO_SOME_EXTENT,
		/** The A_ lot. */
		A_LOT
	}

	/**
	 * The Enum Flamboyance.
	 */
	public enum Flamboyance
	{

		/** The NO t_ flamboyant. */
		NOT_FLAMBOYANT,
		/** The NO t_ ver y_ flamboyant. */
		NOT_VERY_FLAMBOYANT,
		/** The SOMEWHA t_ flamboyant. */
		SOMEWHAT_FLAMBOYANT,
		/** The FLAMBOYANT. */
		FLAMBOYANT,
		/** The VER y_ flamboyant. */
		VERY_FLAMBOYANT;
	}

	/**
	 * The Enum Slang.
	 */
	public enum Slang
	{

		/** The SLANG. */
		SLANG,
		/** The N o_ slang. */
		NO_SLANG
	}

}
